/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * gameRules.java
 *
 * Created on Nov 7, 2010, 4:59:44 PM
 */

package com.client;

/**
 *
 * @author Kritika
 */
public class gameRules extends javax.swing.JFrame {

    /** Creates new form gameRules */
    public gameRules() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTextArea1 = new javax.swing.JTextArea();
        jButton1 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Game Rules");

        jTextArea1.setColumns(20);
        jTextArea1.setLineWrap(true);
        jTextArea1.setRows(5);
        jTextArea1.setText("The game uses a standard 52-card poker deck. The suits of the cards aren’t used in this game, just the value. The game works by keeping a running total that cannot exceed 99. Every time a player plays a standard card (not special), the value is added to the running total.\n\nSpecial cards:\n • Skip (Jack)\n     - Skips the next player’s turn\n     - If there are 2 players, acts like a pass\n • Reverse (4)\n     - Reverses the order in which players play\n     - If there are 2 players, acts like a pass\n • +/- 10 (10)\n     - Add or subtract 10 from the total (player decides)\n • +/- 20 (Queen)\n     - Add or subtract 20 from the total (player decides)\n • 99 (King)\n     - The total is automatically set to 99\n     - Can be played when total is already 99\n\nTo begin, every player is dealt 5 cards. The starting player is randomly selected and the top card on the deck is used to start the game. A starting player is randomly selected and plays on the first card. If the card is a special card, the effect of the special card is used. Play continues clockwise.\n\nSpecial conditions for starting:\n • If the first card is a skip, then the first player is skipped and the next player starts.\n • If the first card is a reverse, then the person to the right starts.\n\nDuring play, the player can only play cards that won’t make the running total exceed 99. If the player has no cards that will keep the total at 99 or below, the player loses. After a player plays a card, they must draw one card from the draw pile.\n\nThe game ends when there is one player remaining. That person is the winner of the game. The game can be played with 2-5 people.\n");
        jScrollPane1.setViewportView(jTextArea1);

        jButton1.setText("Close");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(481, Short.MAX_VALUE)
                .addComponent(jButton1)
                .addContainerGap())
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 550, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 505, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton1))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
       this.setVisible(false);
       this.dispose();
    }//GEN-LAST:event_jButton1ActionPerformed

    /**
    * @param args the command line arguments
    */
//    public static void main(String args[]) {
//        java.awt.EventQueue.invokeLater(new Runnable() {
//            public void run() {
//                new gameRules().setVisible(true);
//            }
//        });
//    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea jTextArea1;
    // End of variables declaration//GEN-END:variables

}
